<template>
  <div class="w-[1150px] p-12 print-style relative bg-white">
    <div class="flex justify-between w-full items-center">
      <div class="w-1/3"></div>
      <div class="text-center font-semibold text-4xl w-1/3">故障事故记录单</div>
      <div class="w-1/3"></div>
    </div>
    <div class="flex-1 mt-8">
      <div class="flex justify-center border-solid items-center border-x-0 border-y-2 py-2">
        <div class="w-1/2 flex">
          <div class="w-1/5">装备名称</div>
          <div class="w-1/5">品牌</div>
          <div class="w-1/5">规格</div>
          <div class="w-1/5">型号</div>
          <div class="w-1/5">单位</div>
        </div>
        <div class="w-1/2 flex">
          <div class="w-1/5">发生时间</div>
          <div class="w-1/5">故障现象</div>
          <div class="w-1/5">原因分析</div>
          <div class="w-1/5">处理结果</div>
          <div class="w-1/5">结论</div>
        </div>
      </div>
      <div v-for="item in dataList" :key="item" class="flex justify-center items-center py-2">
        <div class="w-1/2 flex">
          <div class="w-1/5">{{ item.equipmentName }}</div>
          <div class="w-1/5">{{ item.brand }}</div>
          <div class="w-1/5">{{ item.specifications }}</div>
          <div class="w-1/5">{{ item.model }}</div>
          <div class="w-1/5">{{ item.unit }}</div>
        </div>
        <div class="w-1/2 flex">
          <div class="w-1/5">{{ item.recordTime }}</div>
          <div class="w-1/5">{{ item.faultPhenomenon }}</div>
          <div class="w-1/5">{{ item.causeAnalysis }}</div>
          <div class="w-1/5">{{ item.processingResults }}</div>
          <div class="w-1/5">{{ item.conclusion }}</div>
        </div>
      </div>
    </div>
    <div class="pt-5 flex justify-between mt-4 border-solid border-0 border-t-2">
      <div></div>
      <div class="flex">
        <div>打印人：{{ empName }}</div>
        <div class="ml-10">打印时间：{{ dayjs().format('YYYY-MM-DD HH:mm:ss') }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import dayjs from 'dayjs'
import useUserStore from '@/store/user'

const { empName } = useUserStore()
defineProps({
  dataList: {
    type: Array,
    default: () => []
  }
})
</script>
<style lang="less" scoped></style>
